<?php

namespace App\Admin\Controllers;

use App\Admin\Repositories\HistoryWin;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;

class HistoryWinController extends AdminController
{
    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        return Grid::make(new HistoryWin(), function (Grid $grid) {
            $grid->column('id')->sortable();
            $grid->column('issue');
            $grid->column('red_no');
            $grid->column('red_one');
            $grid->column('red_two');
            $grid->column('red_three');
            $grid->column('red_four');
            $grid->column('red_five');
            $grid->column('red_six');
            $grid->column('odd_num');
            $grid->column('max_cont');

            $grid->disableActions();
            $grid->disableCreateButton();
            $grid->disableColumnSelector();

            $grid->model()->orderBy('id','desc');

            $grid->filter(function (Grid\Filter $filter) {
                $filter->equal('id');
                $filter->like('issue');
                $filter->like('red_no');

            });
        });
    }

}
